package com.mdd.car.provider;

import com.mdd.car.api.VehicleApi;
import com.mdd.car.entity.vehicle.Vehicle;
import com.mdd.car.service.IVehicleService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * @Description
 * @Author 幻速
 * @Date 2024/3/19 15:51
 **/
@Service("vehicleApi")
public class VehicleApiProvider implements VehicleApi {
    @Resource
    IVehicleService iVehicleService;
    @Override
    public void updateState(Long vehicleId,Long status) {
        Vehicle vehicle = iVehicleService.getById(vehicleId);
        vehicle.setRentalStatus(status);
        iVehicleService.updateById(vehicle);
    }
}
